import Vue from 'vue'
import VueRouter from 'vue-router'
import index from '../views/index.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'Index',
    meta: {
        navShow: true,
        title: '聚德项目管理系统'
    },
    component: index,
},
{
    path: '/404',
    component: () =>
        import ('@/views/404'),
    hidden: true
},
{
    path: '/project',
    name: '项目',
    meta: {
        navShow: true,
        title: '聚德项目管理系统'

    },
    component: () =>
        import('../views/project/index.vue')
},
 {
        path: '/management',
        name: '员工管理',
        meta: {
            navShow: true,
            title: '聚德项目管理系统'
        },
        component: () =>
            import ('../views/management/management.vue')
    },
{
    path: '/loadpage',
    name: '落地页',
    meta: {
        navShow: true,
        title: '聚德项目管理系统'
    },
    component: () =>
        import('@/views/loadPage/loadPage.vue')
},
{
    path: '/detail',
    name: '广告列表',
    meta: {
        navShow: true,
        title: '聚德项目管理系统'
    },
    component: () =>
        import('@/views/project/detail.vue')
},
{
    path: '/details/:id',
    name: '项目详情',
    meta: {
        navShow: true,
        title: '聚德项目管理系统',
        activeMenu: '/project',
        projectMenu: '/details'
    },
    component: () =>
        import('../views/project/projectdetails.vue')
},
{
    path: '/projectperson/:id',
    name: '项目人员管理',
    meta: {
        navShow: true,
        title: '聚德项目管理系统',
        activeMenu: '/project',
        projectMenu: '/details'
    },
    component: () =>
        import('../views/project/projectperson.vue')
},
{
    path: '/customer',
    name: '账户',
    meta: {
        navShow: true,
        title: '聚德项目管理系统'
    },
    component: () =>
        import('../views/customer/index.vue')
}, {
    path: '/teams',
    name: '团队',
    meta: {
        navShow: true,
        title: '聚德项目管理系统'
    },
    component: () =>
        import('../views/teams/index.vue')
},
{
    path: '/login',
    name: '登录',
    meta: {
        navShow: false,
        title: '聚德项目管理系统'
    },
    component: () =>
        import('../views/login/login.vue')
},
// 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true }
]
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}
const router = new VueRouter({
    routes
})

export default router